package com.sinosoft.hydra.um.repositories;

import cn.com.sinux.spring.repositories.IBaseRepository;
import com.sinosoft.hydra.um.domain.permission.SysOrganization;
import com.sinosoft.hydra.um.domain.permission.TAttendance;
import com.sinosoft.hydra.um.domain.permission.TDirectory;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * Created by lcb on 2016/8/31.
 */
public interface TAttendanceDAO extends IBaseRepository<TAttendance, String> {

    /**
     * 启用用户
     *
     * @param sysOrganizations 用户主键集
     */
    @Query("from TAttendance where status = '0' and reason in (?1) and applyUser in (select sysUserMember from SysOrganizationUser where sysOrganization in (?2))")
    public List<TAttendance> find(List<TDirectory> directories, List<SysOrganization> sysOrganizations);
}
